package com.repair.base.exception;

/**
 * @author chunyu
 * @since 2024/9/19,15:15
 */
public enum SystemErrorCode implements ErrorCode {
    /**
     * 未知错误
     */
    UNKNOWN_ERROR(2001, "未知错误"),

    /**
     * 数据库插入失败
     */
    INSERT_FAILED(2002, "数据库插入失败"),

    /**
     * 数据库更新失败
     */
    UPDATE_FAILED(2003, "数据库更新失败"),

    /**
     * 数据库更新失败
     */
    SELECT_FAILED(2004, "数据库查询失败"),

    NO_LOGIN(2005, "未登录"),

    /**
     * 文件写入失败
     */
    WRITE_FILE_FAILED(2006, "文件写入失败"),


    ;

    private final Integer code;
    private final String message;

    SystemErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
